<?php
include("librerias/feedcreator.class.php"); 
include("includes/gestionConexion.php");

$rss = new UniversalFeedCreator(); 
$rss->useCached(); 
$rss->title = "NOTICIAS B.P.U. "; 
$rss->description = "Todas las novedades de la Biblioteca Publica Universitaria"; 

$rss->link = "http://localhost/webABD/"; 
$rss->syndicationURL = "http://localhost/webABD/".$_SERVER["PHP_SELF"]; 


mysql_connect("localhost","root","");
mysql_select_db("biblioteca");
//$coN = crearConexion("carlos", "practica");
//$co = $coN->prepare('SELECT * FROM noticias');
//$co->execute();

//$conexion = crearConexion("root","");
//$result = $conexion->query("select * from noticias");
$result = mysql_query("SELECT * FROM noticias");
//foreach ($result as $row){
    while ($row = mysql_fetch_object($result)) {
//	while($row = $co->fetch()){
 
 
 //2008-12-29T19:27:59+01:00 dateFormat($fecha,'c');
 
 //$fechaCorrecta = dateFormat($row->FECHA,'c');

 //$f = date_format($fecha, 'c');
 
    $item = new FeedItem(); 
    $item->title = $row->TITULO; 
    $item->link = "http://localhost/webABD/"; 
    $item->description = $row->DESCRIPCION; 
    
    $item->date = null;
    $item->source = "http://localhost/webABD/"; 
    //$item->author = "Dyno se caga en la puta madre del RSS"; 
     
    $rss->addItem($item); 
 
    
}
//desconectarConexion($co);
mysql_free_result($result);

$rss->saveFeed("RSS1.0", "feed.xml");
?>